# -*- coding: utf-8 -*-
'''
@author: olivia.dou
Created on: 2022/12/6 14:33
desc: 专题获客页面
'''

from appium.webdriver.common.appiumby import AppiumBy

from proj_spec.CLUE.mobile_po.accuisit_by_subject_list_page import AccuisitBySubjectListPage
from proj_spec.CLUE.mobile_po.clue_app_base_page import CLUEAppBasePage


class AccuisitBySubjectPage(CLUEAppBasePage):


    def choose_subject(self, subject):
        """跳转到科技资质企业页面

        :return:
        """
        if self.os == 'android':
            subject_entrance = self.find_element((AppiumBy.ANDROID_UIAUTOMATOR, 'UiSelector().text("%s")'%subject))
        else:
            subject_entrance = self.find_element((AppiumBy.ACCESSIBILITY_ID, subject))
        if subject_entrance is not None:
            subject_entrance.click()
            return AccuisitBySubjectListPage(self.driver)
        else:
            return None
